{% for concept in search_results %} {# loop through the hits #}

<div class="col-lg-12 concept-info boxed">
  {% if bread_crumbs is defined %}
  <div id="crumb-container">
    {% for path in bread_crumbs %}
    {% set crumbId = loop.index %}
      <div class="crumb-path">
      {% for crumb in path %}
      {% if not loop.last %}<a class="propertyvalue bread-crumb{% if crumb.hiddenLabel %} expand-crumbs{% endif %}" href="{{ crumb.uri|link_url(vocab,lang) }}">{{ crumb.prefLabel }}</a><span class="bread-crumb"> > </span>
      {% else %}<span class="bread-crumb propertylabel-pink">{{ crumb.prefLabel }}</span>
      {% endif %}
      {% if crumb.hiddenLabel %}
        {% for hiddenPath in combined %}
          {% if crumbId == loop.index %}
            {% for hiddenCrumb in hiddenPath %}
            <a class="propertyvalue hidden-breadcrumb" href="{{ hiddenCrumb.uri|link_url(vocab,lang) }}">{{ hiddenCrumb.hiddenLabel }}</a><span class="hidden-breadcrumb"> > </span>
            {% endfor %}
          {% endif %}
        {% endfor %}
      {% endif %}
      {% endfor %}
      </div>
    {% endfor %}
  </div>
  {% endif %}
  <table class="table search-results-property-table{% if concept.type == 'skosext:DeprecatedConcept' %} deprecated{% endif %}">
  {% spaceless %}
  <tr>
  <td class="col-md-4">
  <span class="propertyvaluelabel" title="{% trans "skos:prefLabel_help" %}">{% trans "skos:prefLabel" %}:</span>
  </td>
  <td>
  {% if concept.foundBy %} {# hit has been found through an alternative label #}
    <span class="search-parameter-highlight"><span class="foundby">{{ concept.foundBy }}</span>
    {% if concept.ExVocab is defined %}
    <span class="prefLabel conceptlabel redirected-vocab-id"> @{{ concept.ExVocab }}</span>
    {% endif %}
    <br />&nbsp;&nbsp;&#8627; <a class="prefLabel conceptlabel" href="{{ concept.uri | link_url(concept.vocab,lang) }}">{{ concept.label }}</a></span>
  {% else %}
  <span class="prefLabel
    {% if lang_count is not defined and rest != 1 %} propertylabel-pink">{{ concept.label }}</span>{% else %}"></span>
    <a class="prefLabel conceptlabel" href="{% if concept.type == "skos:Collection" %}{{ concept.uri | link_url(concept.vocab, lang, 'collections') }}{% elseif concept.exvocab is defined%}{{ concept.uri | link_url(concept.exvocab,concept.lang) }}{% else %}{{ concept.uri | link_url(concept.vocab,concept.lang) }}{% endif %}">{{ concept.label }}</a>
    {% endif %}
  {% endif %}
  </td>
  </tr>
  {% endspaceless %}
  {% if concept.type == 'skosext:DeprecatedConcept' %}<h2 class="deprecated-alert">{% trans %}deprecated{% endtrans %}</h2>{% endif %}
  {% for property in concept.properties %} {# loop through ConceptProperty objects #}
    <tr><td class="col-md-4"><span class="propertyvaluelabel" >{{ property.label }}:</span><span class="property-mouseover" title="{{ property.description }}"> [?]</span></td><td><ul>
    {% for propval in property.values %} {# loop through ConceptPropertyValue objects #}
        {% if propval.uri %} {# resources with URI #}
        <li>
          {% if propval.label %}
            {% if propval.exvocab and propval.exvocab != propval.vocab %}{# if the property is located in a another vocabulary #}
            <a class="propertyvalue" href="{% if propval.type == "onki:memberOf" %}{{ propval.uri | link_url(propval.vocab, lang, 'collections') }}{% else %}{{ propval.uri | link_url(propval.vocab, propval.lang) }}{% endif %}">{{ propval.label }}</a>
            {% else %}
              <a class="propertyvalue" href="{{ propval.uri | link_url(propval.vocab, lang) }}">{{ propval.label|trans }}</a>
            {% endif %}
            {% if propval.SubMembers %}<div class="subvalue"> {# if property is a group concept that has sub properties #}
              {% for sub_member in propval.SubMembers %}
                <a class="propertyvalue" href="{{ sub_member.uri | link_url(propval.vocab,lang) }}">{{ sub_member.label }}</a><br />
              {% endfor %}
              </div>
            {% endif %}
            {% if propval.lang and propval.lang != lang %}<span class="propertyvalue"> ({{ propval.lang }})</span>{% endif %}     
          {% endif %}
        {% else %} {# Literals (no URI), eg. alternative labels as properties #}
            <li><p>{{ propval.label }}</p>
        {% endif %}</li>
    {% endfor %}
    </ul></td></tr>
  {% endfor %}
  {% if concept.foreignPrefLabels or concept.foreignAltLabels %}<tr><td class="col-md-4"><span class="propertyvaluelabel">{% trans %}foreign prefLabels{% endtrans %}:</span><span class="property-mouseover" title="{% trans "foreign prefLabel help" %}"> [?]</span></td><td>
      <ul>
      {% for lang,labels in concept.foreignPrefLabels %}
        {% for label in labels %}
          <li><p>{{ label }} ({{ lang }})</p></li>
        {% endfor %}
      {% endfor %}
      {% for lang,labels in concept.foreignAltLabels %}
        {% for label in labels %}
          <li><p>{{ label }} ({{ lang }}, {% trans "replaced" %})</p></li>
        {% endfor %}
      {% endfor %}
      </ul></td></tr>
  {% endif %}
    <tr><td class="col-md-4"><span class="propertyvaluelabel">URI:</span></td>
    <td><span class="propertyvalue uri-input-box">{{ concept.uri }}</span></tr>
    <tr><td class="col-md-4"><span class="propertyvaluelabel">{% trans %}Download this concept in SKOS format:{% endtrans %} 
      
    </span></td><td><span class="header-text-small-font-nobold download-text"><a href="{{ path_fix }}rest/v1/{% if concept.vocab != "" %}{{ concept.vocab }}{% else %}{{ vocab.id }}{% endif %}/data?uri={{ concept.uri|url_encode }}&amp;format=application/rdf%2Bxml">RDF/XML <span class="glyphicon glyphicon-floppy-save"></span></a>
      <a href="{{ path_fix }}rest/v1/{% if concept.vocab != "" %}{{ concept.vocab }}{% else %}{{ vocab.id }}{% endif %}/data?uri={{ concept.uri|url_encode }}&amp;format=text/turtle">
        TURTLE <span class="glyphicon glyphicon-floppy-save"></span></a>
    </span></td></tr>
  </table>
  {# umpilisäke #}

  <table class="table search-results-property-table concept-appendix{% if concept.type == 'skosext:DeprecatedConcept' %} deprecated{% endif %}">
  {% for property in concept.mappingProperties %} {# loop through ConceptProperty objects #}
    <tr><td class="col-md-4"><span class="propertyvaluelabel" >{{ property.label }}:</span><span class="property-mouseover" title="{{ property.description }}"> [?]</span></td><td><ul>
    {% for propval in property.values %} {# loop through ConceptPropertyValue objects #}
        {% if propval.uri %} {# resources with URI #}
        <li>
          {% if propval.label %}
            {% if propval.exvocab and propval.exvocab != propval.vocab %}{# if the property is located in a another vocabulary #}
            <a class="propertyvalue" href="{{ propval.uri | link_url(propval.exvocab, propval.lang) }}">{{ propval.label }}</a> @ {{ propval.exvocab }}
            {% else %}
              <a class="propertyvalue" href="{{ propval.uri | link_url(propval.vocab, lang) }}">{{ propval.label }}</a>
            {% endif %}
            {% if propval.SubMembers %}<div class="subvalue"> {# if property is a group concept that has sub properties #}
              {% for sub_member in propval.SubMembers %}
                <a class="propertyvalue" href="{{ sub_member.uri | link_url(propval.vocab,lang) }}">{{ sub_member.label }}</a><br />
              {% endfor %}
              </div>
            {% endif %}
            {% if propval.lang and propval.lang != lang %}<span class="propertyvalue"> ({{ propval.lang }})</span>{% endif %}     
          {% endif %}
        {% endif %}</li>
    {% endfor %}
    </ul></td></tr>
  {% endfor %}
    </table>
</div>
{% endfor %}
